/**
 * javascript RSA encrypt plugin
 * @author qinmudi
 * @since 2013-12-16
 */

;(function($){
	var RsaObj = {
		public_key:'00b0c2732193eebde5b2e278736a22977a5ee1bb99bea18c0681ad97484b4c7f681e963348eb80667b954534293b0a6cbe2f9651fc98c9ee833f343e719c97c670ead8bec704282f94d9873e083cfd41554f356f00aea38d2b07551733541b64790c2c8f400486fd662a3e95fd5edd2acf4d59ca97fad65cc59b8d10cbc5430c53',
		public_length:'10001',
		do_encrypt:function(str){
			if(str=='undefined'){
				throw new Error("Parameter cannot be empty");
			}else{
				var before = new Date();
				var rsa = new RSAKey();
				rsa.setPublic(this.public_key, this.public_length);
				var res = rsa.encrypt(str);
				//return hex2b64(res); base64编码
				return res;
			}
		}
	}
	
	$.enctyptStr = function(str){
		return RsaObj.do_encrypt(str);
	}
})(jQuery);
